<template>
  <div>
    <div
      style="
        font-weight: 400;
        font-size: 13px;
        border-bottom: 1px solid #e5e6ec;
        padding: 0 20px 0 0;
        height: 39px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #86909c;
      "
    >
      <div>编号:{{ processInstanceId }}</div>
    </div>
    <div class="header-box">
      <div class="header-title">
        <div class="header-title-name">流程名称</div>
        <div class="header-title-status">
          <el-tag v-if="flowStatus == 1" type="primary">审批进行中</el-tag>
          <el-tag v-if="flowStatus == 4" type="success">审批完成</el-tag>
          <el-tag v-if="flowStatus == 3" type="danger">审批拒绝</el-tag>
        </div>
      </div>
      <div class="header-detail">
        <div class="header-detail-img">
          <img
            src="../../assets/image/avavav.gif"
            style="width: 24px; height: 24px"
          />
        </div>
        <div class="header-detail-name">{{startUser.username}}</div>
        <div class="header-detail-time">{{startTime}} 提交</div>
      </div>
    </div>
    <GenForm ref="genForm" :formData="formData" style="padding-top: 20px" />
    <EgTimelineParallelTodo
      :his-list="hisList"
      :proceed-tasks="proceedTasks"
      style="padding-top: 20px"
    />
  </div>
</template>
<script setup>
import GenForm from "../../components/FlowDesign/FlowForm/form-generate/gen-form.vue";
import { ref, toRefs } from "vue";
import EgTimelineParallelTodo from "./EgTimelineInner.vue";
/* ts类型定义区域 */
const genForm = ref(null);
/* 定义数据区域 */
const props = defineProps([
  "formData",
  "flowId",
  "hisList",
  "proceedTasks",
  "flowStatus",
  "processInstanceId",
  "startUser",
  "startTime"
]);
const { flowId, formData, hisList, proceedTasks, flowStatus,processInstanceId,startUser,startTime } = toRefs(props);
</script>

<style lang="less" scoped>
// 右侧文本样式
.header-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 20px;
  .header-title {
    display: flex;
    align-items: center;
    .header-title-name {
      font-size: 18px;
      font-family: PingFangSC-Semibold, PingFang SC;
      color: #1d2129;
    }
    .header-title-status {
      margin-left: 14px;
    }
  }
  .header-detail {
    display: flex;
    align-items: center;
    margin-top: 16px;
    .header-detail-img {
      background: #f2f4f5;
      display: flex;
      align-items: center;
      width: fit-content;
      height: 32px;
      border-radius: 16px;
      padding: 4px;
    }
    .header-detail-name {
      user-select: none;
      font-family: PingFangSC-Regular, PingFang SC;
      color: #34383e;
      margin: 0 4px;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      max-width: 64px;
    }
    .header-detail-time {
      margin-left: 20px;
      font-weight: 350;
      color: #86909c;
      font-size: 13px;
      user-select: none;
    }
  }
}
</style>